<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>管理员首页</title>
    <%@ include file="/WEB-INF/common/header.jsp" %>
</head>
<body>
<div class="page-content d-flex align-items-stretch">
    <%@ include file="/WEB-INF/common/navbar.jsp" %>
    <%@ include file="/WEB-INF/common/menu.jsp" %>

    <!-- 内容主体区域 -->

    <div  class="content-inner">
        <form action="" method="get">
            <select name="majId">
                <option value="">全体学生</option>
                <c:forEach items="${majorInfos}" var="majorInfosObject">
                    <c:if test="${majorInfosObject.majId == majId}">
                        <option value="${majorInfosObject.majId}" selected="selected">${majorInfosObject.majTitle}</option>
                    </c:if>
                    <c:if test="${majorInfosObject.majId != majId}">
                        <option value="${majorInfosObject.majId}">${majorInfosObject.majTitle}</option>
                    </c:if>
                </c:forEach>
            </select>
            <input type="submit" value="确定">
        </form>
        <p>======班级专业信息列表=======</p>
        <table width="100%" border="1px" cellpadding="0" cellspacing="0">
            <thead>
            <tr>
                <th>学号</th>
                <th>班级</th>
                <th>入学日期</th>
                <th>专业</th>
                <th>类型</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${students}" var="student">
                <tr>
                    <td>${student.claCode}</td>
                    <td>${student.claName}</td>
                    <td>${student.claCreatDate}</td>
                    <td>${student.majorInfo.majTitle}</td>
                    <td>${student.majorInfo.majId}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <form action="" method="get">
            学生总人数${count},共${allPages}页，
            每一页显示<input type="text" name="pageSize" value="${pageSize}">
            跳转到第<input type="text" name="page" value="${page}">页
            <input type="hidden" name="majId" value="${majId}"><input type="submit" value="确定">

            <a href="${ctx}/all/all-list.action?majId=${majId}&pageSize=${pageSize}&page=1">首页</a>
            <a href="${ctx}/all/all-list.action?majId=${majId}&pageSize=${pageSize}&page=${page-1}">上页</a>
            <a href="${ctx}/all/all-list.action?majId=${majId}&pageSize=${pageSize}&page=${page+1}">下页</a>
            <a href="${ctx}/all/all-list.action?majId=${majId}&pageSize=${pageSize}&page=${allPages}">尾页</a>
        </form>
    </div>


</div>

<%@ include file="/WEB-INF/common/footer.jsp"%>
</body>
</html>
